#pragma once

#include <vector>


template <typename T>
class Stack
{
public:
    Stack() {}

    bool empty() const { return elems_.empty(); }

    void push(const T &e) {
        elems_.push_back(e);
    }

    const T &top() const {
        return elems_.back();
    }

    T &top() {
        return elems_.back();
    }

    T pop() {
        T e = std::move(elems_.back());
        elems_.pop_back();
        return e;
    }

private:
    std::vector<T> elems_;
};
